#!/bash/shell

# 停止hyperledger和dev-运行镜像
#docker stop $(docker ps -a | grep hyperledger | awk '{print $1}')
#docker stop $(docker ps -a | grep dev- | awk '{print $1}')

# 删除hyperledger和dev-运行镜像
#docker rm -f $(docker ps -a | grep hyperledger | awk '{print $1}')
#docker rm -f $(docker ps -a | grep dev- | awk '{print $1}')

# 删除hyperledger和dev-镜像
DOCKER_IMAGE_IDS=$(docker images | grep dev- | awk '{print $3}')
if [ -z "$DOCKER_IMAGE_IDS" -o "$DOCKER_IMAGE_IDS" = " " ]; then
    echo "---- No images available for deletion ----"
else
    docker rmi -f $DOCKER_IMAGE_IDS
fi

DOCKER_IMAGE_IDS=$(docker images | grep hyperledger | awk '{print $3}')
if [ -z "$DOCKER_IMAGE_IDS" -o "$DOCKER_IMAGE_IDS" = " " ]; then
    echo "---- No images available for deletion ----"
else
    docker rmi -f $DOCKER_IMAGE_IDS
fi

docker images